from panda3d.core import Vec3

class MarioIcon:
	'''
		Constructor for the Mario class
		Starts the game loop task (mario's walk class)
	'''
	def __init__(self, parent):
		self.parent = parent
		self.height = self.parent.BLOCK_SIZE
		self.width = self.parent.BLOCK_SIZE
		
		self.loadModel()
	
	'''
		Loads the Mario Model
	'''
	def loadModel(self):
		self.loadTexture()
		self.set2DProps()
		
	'''
		Creates the plane and the texture
		
		Overwrite this in the subclasses of MarioActor to load correct model
	'''
	def loadTexture(self):
		self.model = self.parent.loader.loadModelCopy("models/plane")
		self.texture = self.parent.loader.loadTexture("models/characters/mario/mario_icon_1.png")
		
	'''
		Sets the properties for a two dimensional figure
	'''
	def set2DProps(self):
		self.model.setHpr(Vec3(0,-90,0))
		self.model.setScale(Vec3(self.width, self.height, self.parent.BLOCK_SIZE))
		
		# maximize efficiency
		self.model.setBin("unsorted", 0)
		self.model.setDepthTest(False)
		self.model.setTransparency(1)
		
		self.model.setTexture(self.texture)
		self.model.reparentTo(render)
		
	'''
		Hides the Mario Icon
	'''
	def hide(self):
		self.model.hide()
	
	'''
		Shows the Mario icon
	'''
	def show(self):
		self.model.show()
		
	
		
		
		
		
	